kanzi::Application Class Reference

Application class. More...

#include <kanzi/core.ui/application/application.hpp>

Inheritance diagram for kanzi::Application:
kanzi::Module kanzi::ExampleApplication

Public Types

enum  State {
  Uninitialized, Running, Sleeping, Quitting,
  Error
}
 Enumeration for different application states. More...
 
- Public Types inherited from kanzi::Module
typedef vector< const Metaclass * > MetaclassContainer
 
typedef MetaclassContainer::iterator MetaclassIterator
 

Public Member Functions

 Application ()
 Constructs the application object. More...
 
virtual ~Application ()
 Destructs the application object. More...
 
void initialize (const SystemProperties &systemProperties)
 Initializes the application to a consistent state. More...
 
void uninitialize ()
 Uninitializes the application. More...
 
void initializeGL ()
 Initializes the graphics language subsystem. More...
 
void uninitializeGL ()
 Uninitializes the graphics language subsystem. More...
 
void suspendGL ()
 Suspends the graphics language subsystem. More...
 
void resumeGL ()
 Resumes the graphics language subsystem. More...
 
DomaingetDomain () const
 Access domain. More...
 
Renderer3DgetRenderer3D () const
 Access the renderer. More...
 
Node2DSharedPtr getRoot () const
 Access root node. More...
 
ScreenSharedPtr getScreen () const
 Access screen. More...
 
void setScreen (ScreenSharedPtr screen)
 Set screen. More...
 
KzuTaskSchedulergetTaskScheduler () const
 Access engine task scheduler. More...
 
void queueTaskExecuteOnce (string_view taskName, Scheduler::Task task)
 Queue a task to be executed once by the internal task scheduler. More...
 
ResourceManagergetResourceManager () const
 Access resource manager. More...
 
KzuInputManagergetInputManager () const
 Access input manager. More...
 
KzuBinaryLoadergetBinaryLoader () const
 Access binary loader. More...
 
KzuMessageDispatchergetMessageDispatcher () const
 Access message dispatcher. More...
 
float getFramesPerSecond () const
 Access FPS info. More...
 
virtual void projectReloaded ()
 
size_t getGraphicsOutputCount () const
 Access graphics output count. More...
 
GraphicsOutputSharedPtr getGraphicsOutput (size_t index=0) const
 Access graphics outputs. More...
 
void appendGraphicsOutput (GraphicsOutputSharedPtr graphicsOutput)
 Attach graphics output. More...
 
void removeGraphicsOutput (size_t index=0)
 Remove graphics output. More...
 
size_t getEventSourceCount () const
 Access event source count. More...
 
EventSourceSharedPtr getEventSource (size_t index=0) const
 Access event sources. More...
 
void appendEventSource (EventSourceSharedPtr eventSource)
 Attach event source. More...
 
void removeEventSource (size_t index=0)
 Remove event source. More...
 
State getState ()
 Access application state. More...
 
chrono::microseconds getLastFrameTime () const
 Gets time taken to render last frame. More...
 
ApplicationProperties getApplicationProperties () const
 Access application properties. More...
 
void main (const SystemProperties &systemProperties)
 Application entry point. More...
 
void run ()
 Application main loop. More...
 
void update (chrono::milliseconds deltaTime)
 Updates application logic. More...
 
void render ()
 Renders the root layer. More...
 
void suspend ()
 Suspends the thread for the remainder of the frame. More...
 
void yield ()
 Irrevocably suspends the thread for the remainder of the frame. More...
 
void progressDeploymentQueue ()
 Processes the deployment queue for asynchronous loading tasks. More...
 
void sleep ()
 Puts the application to sleep as soon as possible. More...
 
void wakeup ()
 Wakes up the application from sleep as soon as possible. More...
 
void quit ()
 Quits the application as soon as possible. More...
 
void beginFrame (const GraphicsOutput &graphicsOutput)
 
void renderFrame1 (const GraphicsOutput &graphicsOutput, bool toolPresent, const RenderPassSharedPtr &debugComposer)
 
void renderFrame2 ()
 
void renderFrame3 ()
 
void postRender (const GraphicsOutput &graphicsOutput)
 
void endFrame ()
 
void update1 (chrono::milliseconds deltaTime, const GraphicsOutput &graphicsOutput, kzBool)
 
void update2 (chrono::milliseconds deltaTime, const GraphicsOutput &graphicsOutput, kzBool toolPresent, kzBool centerViewport)
 
void executePendingChanges (kzBool toolPresent)
 
void projectReloaded (bool isToolPresent)
 
void initializeProject (kzBool toolPresent)
 
void initializeProjectTask (kzBool toolPresent)
 
void reloadProject (kzUint byteCount, const byte *bytes, bool isToolPresent)
 
void reloadProjectFromFile (kzString binaryPath, bool isToolPresent)
 
void reloadProjectFromFileResource (kzString resourceFile, bool isToolPresent)
 
void initializeGLContext ()
 
void uninitializeGLContext ()
 
ApplicationProperties::PerformanceInfoLevel getPerformanceInfoLevel () const
 Gets performance info level. More...
 
void setPerformanceInfoLevel (ApplicationProperties::PerformanceInfoLevel level)
 Sets performance info level. More...
 
StopWatchgetStopWatch ()
 Gets default main loop timer. More...
 
void setAllowIndefiniteSleep (bool enabled)
 Sets or resets flag for allowing indefinite sleep. More...
 
bool isRenderRequired () const
 Returns whether an immediate redraw is needed. More...
 
- Public Member Functions inherited from kanzi::Module
 Module ()
 
virtual MetaclassContainer getMetaclassesOverride ()
 
virtual void destroy ()
 
virtual void registerMetadataOverride (ObjectFactory &)
 
void setDomain (Domain *domain)
 Set the domain. More...
 

Protected Member Functions

virtual void onStartup ()
 Function callback for application start. More...
 
virtual void onShutdown ()
 Function callback for application end. More...
 
virtual void onProjectLoaded ()
 Function callback for initialization that is using the .KZB data. This function is called right after the .KZB binaries have been loaded. More...
 
virtual void onConfigure (ApplicationProperties &configuration)
 User-defined configuration. More...
 
virtual void onUpdate (chrono::milliseconds deltaTime)
 Function callback for updating logic. More...
 
virtual void onPreRender ()
 Function callback for rendering. This function is called for every frame before any other rendering function. More...
 
virtual void onPostRender ()
 Function callback for rendering. This function is called for every frame after the root layer has been rendered. More...
 
virtual void onPointerInputEvent (const KzsInputEventPointer *inputData)
 Event callback for pointing device (e.g. mouse or touch screen) input events. More...
 
virtual void onKeyInputEvent (const KzsInputEventKey *inputData)
 Event callback for keyboard input events. More...
 
virtual void onIdle ()
 Event callback for idle loop. More...
 
virtual void onSleep ()
 Event callback for application sleep. More...
 
virtual void onWakeup ()
 Event callback for application wakeup. More...
 
virtual void initializeOverride (const SystemProperties &systemProperties)
 Override function for initialize(). More...
 
virtual void uninitializeOverride ()
 Override function for uninitialize(). More...
 
virtual void initializeGLOverride ()
 Override function for initializeGL(). More...
 
virtual void uninitializeGLOverride ()
 Override function for uninitializeGL(). More...
 
virtual void suspendGLOverride ()
 Override function for suspendGL(). More...
 
virtual void resumeGLOverride ()
 Override function for resumeGL(). More...
 
virtual void mainOverride (const SystemProperties &systemProperties)
 Override function for main(). More...
 
virtual void updateOverride (chrono::milliseconds deltaTime)
 Override function for update(). More...
 
virtual void renderOverride ()
 Override function for render(). More...
 
virtual void suspendOverride ()
 Override function for suspend(). More...
 
virtual void yieldOverride ()
 Override function for yield(). More...
 
virtual void sleepOverride ()
 Override function for sleep(). More...
 
virtual void wakeupOverride ()
 Override function for wakeup(). More...
 
virtual void onProjectInitialized ()
 
virtual void progressDeploymentQueueOverride ()
 Override function for progressDeploymentQueue(). More...
 
virtual void initializeProperties (const SystemProperties &systemProperties)
 
virtual void initializeEngine ()
 
virtual void initializeSystem ()
 
void projectInitialized ()
 
void projectLoaded ()
 
virtual void renderEngine ()
 
virtual void handleEvents (const KzsEventQueue *eventQueue)
 
virtual bool isToolPresent () const
 
virtual void runOverride ()
 Override function for run(). More...
 
void idle ()
 
void idleLoop ()
 
void loadPlugins ()
 
void logGraphicsInformation ()
 Log graphics information based on application properties. More...
 
KzuEnginegetEngine () const
 Access engine. More...
 
PerformanceInfoacquirePerformanceInfo ()
 Acquire performance info object. More...
 
optional< chrono::milliseconds > getProposedSleepTime (chrono::milliseconds deltaTime)
 Gets the time main thread can sleep in milliseconds, supposing given duration would have passed from the start of the frame. More...
 
chrono::milliseconds getProposedSleepTimePostRender (chrono::milliseconds deltaTime)
 Gets the time the main thread can sleep after rendering. More...
 
- Protected Member Functions inherited from kanzi::Module
virtual ~Module ()
 

Protected Attributes

vector< EventSourceSharedPtrm_eventSources
 Container for event sources. More...
 
vector< GraphicsOutputSharedPtrm_graphicsOutputs
 Container for graphics outputs. More...
 
State m_state
 Current state of the application. More...
 
SystemProperties m_systemProperties
 System properties. More...
 
ApplicationProperties m_applicationProperties
 Application properties. More...
 
KzcMemoryManagerm_systemMemoryManager
 System memory manager (legacy). More...
 
KzsEventQueue * m_eventQueue
 The event queue for user input and window events. More...
 
KzsEventQueue * m_eventQueueBuffer
 Temporary event queue used for combining similar events. More...
 
KzuEnginem_engine
 Engine instance. More...
 
Scheduler m_scheduler
 Execution scheduler. More...
 
unique_ptr< PerformanceInfom_performanceInfo
 Performance info. More...
 
bool m_projectLoaded
 Flag to be set when project has been loaded. More...
 
SuspensionManager m_suspensionManager
 Suspension manager for main loop. More...
 
- Protected Attributes inherited from kanzi::Module
Domainm_domain
 The domain this module is registered to. More...
 

Friends

class PreviewApplication
 

Detailed Description

Application class.

Base class for application logic.

Member Enumeration Documentation

Enumeration for different application states.

Enumerator
Uninitialized 

The application is not yet initialized.

Running 

The application is running normally.

Sleeping 

The application is sleeping. The OpenGL graphics context is destroyed.

Quitting 

The application is in the process of quitting without errors.

Error 

The application has encountered an error and exits immediately.

Constructor & Destructor Documentation

kanzi::Application::Application ( )
explicit

Constructs the application object.

virtual kanzi::Application::~Application ( )
virtual

Destructs the application object.

Member Function Documentation

void kanzi::Application::initialize ( const SystemProperties systemProperties)

Initializes the application to a consistent state.

This is the first function called by the application framework after constructing the application. This function tries to read the file application.cfg and shouldn't be called before the file system of the operating system has been initialized.

The default behavior can be changed by overriding initializeOverride().

Parameters
systemPropertiesCommand line parameters of the program.
void kanzi::Application::uninitialize ( )

Uninitializes the application.

This is the last function called by the application framework before destruction.

The default behavior can be changed by overriding uninitializeOverride().

void kanzi::Application::initializeGL ( )

Initializes the graphics language subsystem.

This function is called by the application framework before entering the program main loop, but after a GL context has been activated. It initializes OpenGL-related subsystems.

The default behavior can be changed by overriding initializeGLOverride().

void kanzi::Application::uninitializeGL ( )

Uninitializes the graphics language subsystem.

This function is called by the application framework after exiting the program main loop, but before a GL context has been deactivated. It undeploys all GPU resources.

The default behavior can be changed by overriding uninitializeGLOverride().

void kanzi::Application::suspendGL ( )

Suspends the graphics language subsystem.

This function is called by the application framework during application suspension, on systems where the graphics language resources are not guaranteed to be retained until the application resumes. It undeploys all GPU resources and reschedules them for redeployment.

When your applications suspends, the GPU resources not stored in a .kzb file become invalid. Destroy these resources and recreate them on resume. Make sure that after recreating a resource the pointers are correct. Kanzi automatically restores all other resources.

The default behavior can be changed by overriding suspendGLOverride().

void kanzi::Application::resumeGL ( )

Resumes the graphics language subsystem.

This function is called by the application framework during application resume, if suspendGL() was called during suspension. It deploys GPU resources that were undeployed during suspendGL().

The default behavior can be changed by overriding resumeGLOverride().

Domain* kanzi::Application::getDomain ( ) const

Access domain.

Returns
Pointer to domain.
Renderer3D* kanzi::Application::getRenderer3D ( ) const

Access the renderer.

Returns
Renderer3D pointer.
Node2DSharedPtr kanzi::Application::getRoot ( ) const

Access root node.

Returns
Node shared pointer.
ScreenSharedPtr kanzi::Application::getScreen ( ) const

Access screen.

Returns
Screen shared pointer.
void kanzi::Application::setScreen ( ScreenSharedPtr  screen)

Set screen.

KzuTaskScheduler* kanzi::Application::getTaskScheduler ( ) const

Access engine task scheduler.

Returns
Engine task scheduler pointer.
void kanzi::Application::queueTaskExecuteOnce ( string_view  taskName,
Scheduler::Task  task 
)

Queue a task to be executed once by the internal task scheduler.

Parameters
taskNameTask name, must be unique.
taskTask to execute.
ResourceManager* kanzi::Application::getResourceManager ( ) const

Access resource manager.

Returns
Resource manager pointer.
KzuInputManager* kanzi::Application::getInputManager ( ) const

Access input manager.

Returns
Input manager pointer.
KzuBinaryLoader* kanzi::Application::getBinaryLoader ( ) const

Access binary loader.

Returns
Binary loader pointer.
KzuMessageDispatcher* kanzi::Application::getMessageDispatcher ( ) const

Access message dispatcher.

Returns
Message dispatcher pointer.
float kanzi::Application::getFramesPerSecond ( ) const

Access FPS info.

Returns
Frames per second measurement.
virtual void kanzi::Application::projectReloaded ( )
virtual
size_t kanzi::Application::getGraphicsOutputCount ( ) const

Access graphics output count.

Returns
Number of attached graphics output.
GraphicsOutputSharedPtr kanzi::Application::getGraphicsOutput ( size_t  index = 0) const

Access graphics outputs.

Parameters
indexIndex of the graphics output to access.
Returns
Shared pointer to the specified graphics output.
void kanzi::Application::appendGraphicsOutput ( GraphicsOutputSharedPtr  graphicsOutput)

Attach graphics output.

Parameters
graphicsOutputShared pointer to the graphics output to attach.
void kanzi::Application::removeGraphicsOutput ( size_t  index = 0)

Remove graphics output.

Parameters
indexIndex of the graphics output to remove.
size_t kanzi::Application::getEventSourceCount ( ) const

Access event source count.

Returns
Number of attached event sources.
EventSourceSharedPtr kanzi::Application::getEventSource ( size_t  index = 0) const

Access event sources.

Parameters
indexIndex of the event source to access.
Returns
Shared pointer to the specified event source.
void kanzi::Application::appendEventSource ( EventSourceSharedPtr  eventSource)

Attach event source.

Parameters
eventSourceShared pointer to the event source to attach.
void kanzi::Application::removeEventSource ( size_t  index = 0)

Remove event source.

Parameters
indexIndex of the event source to remove.
State kanzi::Application::getState ( )

Access application state.

Returns
Current application state.
chrono::microseconds kanzi::Application::getLastFrameTime ( ) const

Gets time taken to render last frame.

ApplicationProperties kanzi::Application::getApplicationProperties ( ) const

Access application properties.

Returns
Current application properties.
void kanzi::Application::main ( const SystemProperties systemProperties)

Application entry point.

This high-level function implements the default initialization and main loop. It is called by the application framework, except on callbacks-only systems.

The default behavior can be changed by overriding mainOverride().

Parameters
systemPropertiesCommand line parameters of the program.
void kanzi::Application::run ( )

Application main loop.

Does not return while application is in Running state.

void kanzi::Application::update ( chrono::milliseconds  deltaTime)

Updates application logic.

This function is called once per frame during normal operation. It refreshes the application state and prepares the scene for rendering.

The default behavior can be changed by overriding updateOverride().

Parameters
deltaTimeThe time elapsed since the previous call to update().
void kanzi::Application::render ( )

Renders the root layer.

This function is called after update once per frame during normal operation. It renders the current scene.

The default behavior can be changed by overriding renderOverride().

void kanzi::Application::suspend ( )

Suspends the thread for the remainder of the frame.

May suspend indefinitely, if there is no reason to update. Will return when there is input or a queued task available.

void kanzi::Application::yield ( )

Irrevocably suspends the thread for the remainder of the frame.

void kanzi::Application::progressDeploymentQueue ( )

Processes the deployment queue for asynchronous loading tasks.

By default this function processes a single item from the deployment queue of background loading tasks every frame.

You can change the default behavior of the function by overriding the progressDeploymentQueueOverride() function.

void kanzi::Application::sleep ( )

Puts the application to sleep as soon as possible.

void kanzi::Application::wakeup ( )

Wakes up the application from sleep as soon as possible.

void kanzi::Application::quit ( )

Quits the application as soon as possible.

void kanzi::Application::beginFrame ( const GraphicsOutput graphicsOutput)
void kanzi::Application::renderFrame1 ( const GraphicsOutput graphicsOutput,
bool  toolPresent,
const RenderPassSharedPtr debugComposer 
)
void kanzi::Application::renderFrame2 ( )
void kanzi::Application::renderFrame3 ( )
void kanzi::Application::postRender ( const GraphicsOutput graphicsOutput)
void kanzi::Application::endFrame ( )
void kanzi::Application::update1 ( chrono::milliseconds  deltaTime,
const GraphicsOutput graphicsOutput,
kzBool   
)
void kanzi::Application::update2 ( chrono::milliseconds  deltaTime,
const GraphicsOutput graphicsOutput,
kzBool  toolPresent,
kzBool  centerViewport 
)
void kanzi::Application::executePendingChanges ( kzBool  toolPresent)
void kanzi::Application::projectReloaded ( bool  isToolPresent)
void kanzi::Application::initializeProject ( kzBool  toolPresent)
void kanzi::Application::initializeProjectTask ( kzBool  toolPresent)
void kanzi::Application::reloadProject ( kzUint  byteCount,
const byte bytes,
bool  isToolPresent 
)
void kanzi::Application::reloadProjectFromFile ( kzString  binaryPath,
bool  isToolPresent 
)
void kanzi::Application::reloadProjectFromFileResource ( kzString  resourceFile,
bool  isToolPresent 
)
void kanzi::Application::initializeGLContext ( )
void kanzi::Application::uninitializeGLContext ( )
ApplicationProperties::PerformanceInfoLevel kanzi::Application::getPerformanceInfoLevel ( ) const
inline

Gets performance info level.

If performance info is not #PerformanceInfoDisabled, textual information HUD will be drawn after onPostRender has been called.

void kanzi::Application::setPerformanceInfoLevel ( ApplicationProperties::PerformanceInfoLevel  level)
inline

Sets performance info level.

Equal to application configuration has "PerformanceInfoLevel" option. Setting the level to #PerformanceInfoDisabled (0) will turn off the display (default). Setting the level to #PerformanceInfoFPS (1) will display framerate. Setting the level to #PerformanceInfoFull (2) will display additional information about rendering batches.

StopWatch& kanzi::Application::getStopWatch ( )

Gets default main loop timer.

void kanzi::Application::setAllowIndefiniteSleep ( bool  enabled)
inline

Sets or resets flag for allowing indefinite sleep.

Parameters
enabledTrue to enable indefinite sleep, false to always wake up in frame time.
bool kanzi::Application::isRenderRequired ( ) const

Returns whether an immediate redraw is needed.

Returns
True, if rendering should be done as soon as possible.
virtual void kanzi::Application::onStartup ( )
protectedvirtual

Function callback for application start.

virtual void kanzi::Application::onShutdown ( )
protectedvirtual

Function callback for application end.

virtual void kanzi::Application::onProjectLoaded ( )
protectedvirtual

Function callback for initialization that is using the .KZB data. This function is called right after the .KZB binaries have been loaded.

virtual void kanzi::Application::onConfigure ( ApplicationProperties configuration)
protectedvirtual

User-defined configuration.

This callback is called after application.cfg is read, but before the graphics language subsystem is initialized.

Parameters
configurationAllows modification of the application properties.

Reimplemented in kanzi::ExampleApplication.

virtual void kanzi::Application::onUpdate ( chrono::milliseconds  deltaTime)
protectedvirtual

Function callback for updating logic.

This function is called for every frame.

Parameters
deltaTimeThe delta time passed to update(). By default this is the time elapsed since the previous frame in milliseconds.
virtual void kanzi::Application::onPreRender ( )
protectedvirtual

Function callback for rendering. This function is called for every frame before any other rendering function.

virtual void kanzi::Application::onPostRender ( )
protectedvirtual

Function callback for rendering. This function is called for every frame after the root layer has been rendered.

virtual void kanzi::Application::onPointerInputEvent ( const KzsInputEventPointer *  inputData)
protectedvirtual

Event callback for pointing device (e.g. mouse or touch screen) input events.

virtual void kanzi::Application::onKeyInputEvent ( const KzsInputEventKey *  inputData)
protectedvirtual

Event callback for keyboard input events.

Reimplemented in kanzi::ExampleApplication.

virtual void kanzi::Application::onIdle ( )
protectedvirtual

Event callback for idle loop.

virtual void kanzi::Application::onSleep ( )
protectedvirtual

Event callback for application sleep.

virtual void kanzi::Application::onWakeup ( )
protectedvirtual

Event callback for application wakeup.

virtual void kanzi::Application::initializeOverride ( const SystemProperties systemProperties)
protectedvirtual

Override function for initialize().

virtual void kanzi::Application::uninitializeOverride ( )
protectedvirtual

Override function for uninitialize().

virtual void kanzi::Application::initializeGLOverride ( )
protectedvirtual

Override function for initializeGL().

virtual void kanzi::Application::uninitializeGLOverride ( )
protectedvirtual

Override function for uninitializeGL().

virtual void kanzi::Application::suspendGLOverride ( )
protectedvirtual

Override function for suspendGL().

virtual void kanzi::Application::resumeGLOverride ( )
protectedvirtual

Override function for resumeGL().

virtual void kanzi::Application::mainOverride ( const SystemProperties systemProperties)
protectedvirtual

Override function for main().

virtual void kanzi::Application::updateOverride ( chrono::milliseconds  deltaTime)
protectedvirtual

Override function for update().

virtual void kanzi::Application::renderOverride ( )
protectedvirtual

Override function for render().

virtual void kanzi::Application::suspendOverride ( )
protectedvirtual

Override function for suspend().

virtual void kanzi::Application::yieldOverride ( )
protectedvirtual

Override function for yield().

virtual void kanzi::Application::sleepOverride ( )
protectedvirtual

Override function for sleep().

virtual void kanzi::Application::wakeupOverride ( )
protectedvirtual

Override function for wakeup().

virtual void kanzi::Application::onProjectInitialized ( )
protectedvirtual
virtual void kanzi::Application::progressDeploymentQueueOverride ( )
protectedvirtual

Override function for progressDeploymentQueue().

virtual void kanzi::Application::initializeProperties ( const SystemProperties systemProperties)
protectedvirtual
virtual void kanzi::Application::initializeEngine ( )
protectedvirtual
virtual void kanzi::Application::initializeSystem ( )
protectedvirtual
void kanzi::Application::projectInitialized ( )
protected
void kanzi::Application::projectLoaded ( )
protected
virtual void kanzi::Application::renderEngine ( )
protectedvirtual
virtual void kanzi::Application::handleEvents ( const KzsEventQueue *  eventQueue)
protectedvirtual
virtual bool kanzi::Application::isToolPresent ( ) const
inlineprotectedvirtual
virtual void kanzi::Application::runOverride ( )
protectedvirtual

Override function for run().

void kanzi::Application::idle ( )
protected
void kanzi::Application::idleLoop ( )
protected
void kanzi::Application::loadPlugins ( )
protected
void kanzi::Application::logGraphicsInformation ( )
protected

Log graphics information based on application properties.

KzuEngine* kanzi::Application::getEngine ( ) const
protected

Access engine.

Returns
Engine instance.
PerformanceInfo& kanzi::Application::acquirePerformanceInfo ( )
protected

Acquire performance info object.

Will create the object if it does not exist.

optional<chrono::milliseconds> kanzi::Application::getProposedSleepTime ( chrono::milliseconds  deltaTime)
protected

Gets the time main thread can sleep in milliseconds, supposing given duration would have passed from the start of the frame.

The time passed is used to determine the remaining sleep time of this frame, for example when some time has elapsed in animations.

Parameters
deltaTimeTime passed since the frame started.
Returns
Maximum time the main thread should sleep. Nothing, if indefinite sleep is proposed.
chrono::milliseconds kanzi::Application::getProposedSleepTimePostRender ( chrono::milliseconds  deltaTime)
protected

Gets the time the main thread can sleep after rendering.

Time spent since beginning of the frame is given so the time spent in rendering can be determined.

Returns
Maximum time the main thread should sleep.

Friends And Related Function Documentation

friend class PreviewApplication
friend

Member Data Documentation

vector<EventSourceSharedPtr> kanzi::Application::m_eventSources
protected

Container for event sources.

vector<GraphicsOutputSharedPtr> kanzi::Application::m_graphicsOutputs
protected

Container for graphics outputs.

State kanzi::Application::m_state
protected

Current state of the application.

SystemProperties kanzi::Application::m_systemProperties
protected

System properties.

ApplicationProperties kanzi::Application::m_applicationProperties
protected

Application properties.

KzcMemoryManager* kanzi::Application::m_systemMemoryManager
protected

System memory manager (legacy).

KzsEventQueue* kanzi::Application::m_eventQueue
protected

The event queue for user input and window events.

KzsEventQueue* kanzi::Application::m_eventQueueBuffer
protected

Temporary event queue used for combining similar events.

KzuEngine* kanzi::Application::m_engine
protected

Engine instance.

Scheduler kanzi::Application::m_scheduler
protected

Execution scheduler.

unique_ptr<PerformanceInfo> kanzi::Application::m_performanceInfo
protected

Performance info.

bool kanzi::Application::m_projectLoaded
protected

Flag to be set when project has been loaded.

SuspensionManager kanzi::Application::m_suspensionManager
protected

Suspension manager for main loop.


The documentation for this class was generated from the following file: